package com.imddy.logtest.log;

import org.apache.log4j.Logger;

public class LoggerWrap {
	
	private Logger logger = null;

	public Logger getLogger() {
		return logger;
	}

	public void setLogger(Logger logger) {
		this.logger = logger;
	}
	
	public void info(Object object, String message) {
		StringBuilder sb = new StringBuilder();
		sb.append(DateTime.getDateTimeStr());
		sb.append("----->");
		sb.append(object.toString());
		sb.append("----->");
		sb.append(message);
		logger.info(sb.toString());
	}
	
	public void info(String message, Exception exception) {
		logger.info(message, exception);
	}
	
	public void warn(Object object, String message) {
		StringBuilder sb = new StringBuilder();
		sb.append(DateTime.getDateTimeStr());
		sb.append("----->");
		sb.append(object.toString());
		sb.append("----->");
		sb.append(message);
		logger.warn(sb.toString());
	}
	
	public void warn(String message, Exception exception) {
		logger.warn(message, exception);
	}
	
	public void error(Object object, String message) {
		StringBuilder sb = new StringBuilder();
		sb.append(DateTime.getDateTimeStr());
		sb.append("----->");
		sb.append(object.toString());
		sb.append("----->");
		sb.append(message);
		logger.error(sb.toString());
	}

	public void error(String message, Exception exception) {
		logger.error(message, exception);
	}
	
}
